/**
 * Created by lvlq on 16/1/14.
 */
var express = require("express");
var app = express();
var uuid = require("uuid");
app.set("views", __dirname + "/Tpl");
app.set("name", "Index");
require("../Farmework")(app);
//do yourself ...
app.use(function (req, res, next) {
    var uid = req.cookies.uid;
    if (!uid) {
        uid = uuid.v1();
        res.cookie("uid", uid, {maxAge: 365 * 24 * 60 * 60 * 1000});
        console.log(uid);
    }
    console.log(uid);
    next();
});

require("./Lib")(app);

module.exports = app;